{% extends "base.html" %}

{% block head-title %}{{algorithm.algorithm_name}}{% endblock %}

{% block title %}{{algorithm.algorithm_name}}{% endblock %}

{% block content %}
{% ifequal algorithm.algorithm_name "DBSCAN" %}
<div class="uk-alert" data-uk-alert>
    <a href="" class="uk-alert-close uk-close"></a>
    <p>在DBSCAN聚类算法中，类别为-1的点为噪声点，不属于任何一个类别。</p>
</div>
{% endifequal %}
<div style="float: right;">
	<a href="/static/{{algorithm.instance_id}}/result.xlsx"
		class="uk-button uk-button-success" target="_blank">数据文件</a>
	<a href="/show_source_code?instance_id={{algorithm.instance_id}}"
		class="uk-button uk-button-primary" target="_blank">源代码</a>
</div>
<h2>数据源</h2>
<table class="uk-table uk-table-striped">
	<caption>记录数:{{algorithm.data_source_size}}</caption>
	<thead>
		<tr>
			<th>序号</th> 
			{% for column in algorithm.data_source.columns %}
			<th>{{ column }}</th> 
			{% endfor %}
		</tr>
	</thead>
	<tbody>
		{% for values in algorithm.data_source.head.values %}
		<tr>
			<td>{{ forloop.counter }}</td>
			{% for value in values%}
			<td>{{ value }}</td>
			{% endfor %}
		</tr>
		{% endfor %}
	</tbody>
</table>
<hr />

<h2>模型</h2>
<table class="uk-table uk-table-striped">
	<thead>
		<tr>
			<th>项目</th>
			<th>内容</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>输入字段</td>
			<td>{{ algorithm.input_field_names|join:"|" }}</td>
		</tr>
		
		{% ifequal algorithm.algorithm_name "K均值" %}
		<tr>
			<td>K值</td>
			<td>{{ algorithm.k_value }}</td>
		</tr>
		
		<tr>
			<td>簇中心点</td>
			<td>{{ algorithm.cluster_centers }}</td>
		</tr>
		{% endifequal %}
		
		{% ifequal algorithm.algorithm_name "DBSCAN" %}
		<tr>
			<td>扫描半径</td>
			<td>{{ algorithm.eps }}</td>
		</tr>
		
		<tr>
			<td>最小包含点数</td>
			<td>{{ algorithm.min_samples }}</td>
		</tr>
		
		<tr>
			<td>噪声点数</td>
			<td>{{ algorithm.uncluster_point_count }}</td>
		</tr>
		{% endifequal %}
		
		{% ifequal algorithm.algorithm_name "BIRCH" %}
		<tr>
			<td>输入类别数</td>
			<td>{{ algorithm.n_clusters }}</td>
		</tr>
		{% endifequal %}
		
		<tr>
			<td>实际类别数</td>
			<td>{{ algorithm.cluster_count }}</td>
		</tr>
		
		<tr>
			<td>类别分布</td>
			<td>
				<a href="/static/{{algorithm.instance_id}}/chart/pie.png" title="点击查看大图" target="_blank">
					<img src="/static/{{algorithm.instance_id}}/chart/pie.png" width="300px"/>
				</a>
			</td>
		</tr>
		
		{% ifequal algorithm.input_field_names|length 2 %}
		<tr>
			<td>散点图</td>
			<td>
				<a href="/static/{{algorithm.instance_id}}/chart/scatter.png" title="点击查看大图" target="_blank">
					<img src="/static/{{algorithm.instance_id}}/chart/scatter.png" width="300px"/>
				</a>
			</td>
		</tr>
		{% endifequal %}
		
	</tbody>
</table>
<hr />



{% endblock %}